
import { PluginOption, UserConfig, ConfigEnv } from 'vite'
import { dtPlugins } from "@zm-pkg/plugins4"
import { SERVE_CONF } from './proxy.config'

export default ( { command, mode }: ConfigEnv ): UserConfig => {
  return {
    css: {
      preprocessorOptions: {
        less: {
          modifyVars: {
            hack: `true; @import (reference) "./src/styles/antDesign.less";`
          },
          javascriptEnabled: true,
        }
      }
    },
    server: SERVE_CONF,
    plugins: [
      dtPlugins({
        isBuild: command === 'build',
      }) as PluginOption[],
    ],
  }
}
